VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Translates word and numeral numbers to spanish. example: MyTextBox.Text = Translate(ENG>SPAN, 13

by Mierdante (1 Submission)
Category: Miscellaneous
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Thu 25th January 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Translates word and numeral numbers to spanish. example: MyTextBox.Text = Translate("ENG>SPAN", "13") would translate 13 into trece.

Rate Translates word and numeral numbers to spanish. example: MyTextBox.Text = Translate(ENG>SPAN, 13



'***********************************************
'*      ENGLISH TO SPANISH NUMBER CONVERTER    *
'*       Converts number words and numbers     *
'*                  By: Mierdante              *
'*                    Version 1                *
'*                                             *
'*   Well, here's my first module. This module *
'* will convert numerical and word numbers into*
'* it's spanish equivalent. For example, 8 or  *
'* eight would convert to ocho. It will convert*
'* any number from 0-20. Spanish->English      *
'* conversion has not been done yet. This is   *
'* my first code snippet submitted to PSC and  *
'* vbcode.com, so don't expect much. Thanks for*
'* trying it out. If you need any help, email  *
'* me at [email protected].                *
'***********************************************
Public Function Translate(Language As String, Text As String) As String
'Spanish to english not done yet.
'If Language = "SPAN>ENG" Then SpanEng (Text)
If Language = "ENG>SPAN" Then Translate = EngSpan(Text)
End Function
Private Function EngSpan(strText As String) As String
'*****START 1-10*****
If strText = "zero" Or strText = "0" Then
EngSpan = "cero"
ElseIf strText = "one" Or strText = "1" Then
EngSpan = "uno"
ElseIf strText = "two" Or strText = "2" Then
EngSpan = "dos"
ElseIf strText = "three" Or strText = "3" Then
EngSpan = "tres"
ElseIf strText = "four" Or strText = "4" Then
EngSpan = "cuatro"
ElseIf strText = "five" Or strText = "5" Then
EngSpan = "cinco"
ElseIf strText = "six" Or strText = "6" Then
EngSpan = "seis"
ElseIf strText = "seven" Or strText = "7" Then
EngSpan = "siete"
ElseIf strText = "eight" Or strText = "8" Then
EngSpan = "ocho"
ElseIf strText = "nine" Or strText = "9" Then
EngSpan = "nueve"
ElseIf strText = "ten" Or strText = "10" Then
EngSpan = "diez"
'*****END 1-10*****
'*****START 11-20*****
ElseIf strText = "eleven" Or strText = "11" Then
EngSpan = "once"
ElseIf strText = "twelve" Or strText = "12" Then
EngSpan = "doce"
ElseIf strText = "thirteen" Or strText = "13" Then
EngSpan = "trece"
ElseIf strText = "fourteen" Or strText = "14" Then
EngSpan = "catorce"
ElseIf strText = "fifteen" Or strText = "15" Then
EngSpan = "quince"
ElseIf strText = "sixteen" Or strText = "16" Then
EngSpan = "dieciseis"
ElseIf strText = "seventeen" Or strText = "17" Then
EngSpan = "dieceisiete"
ElseIf strText = "eighteen" Or strText = "18" Then
EngSpan = "dieceocho"
ElseIf strText = "nineteen" Or strText = "19" Then
EngSpan = "diecenueve"
ElseIf strText = "twenty" Or strText = "20" Then
EngSpan = "veinte"
Else
EngSpan = "Not Recognized. This module will only translate word/numbers 1-20"
End If
End Function

Download this snippet    Add to My Saved Code

Translates word and numeral numbers to spanish. example: MyTextBox.Text = Translate(ENG>SPAN, 13 Comments

No comments have been posted about Translates word and numeral numbers to spanish. example: MyTextBox.Text = Translate(ENG>SPAN, 13. Why not be the first to post a comment about Translates word and numeral numbers to spanish. example: MyTextBox.Text = Translate(ENG>SPAN, 13.

Post your comment

Subject:
Message:
0/1000 characters